﻿/**
* ...
* @author Default
*/

package model;
import hails.HailsDbRecord;

class User extends HailsDbRecord {
	public var name:String;
	public var address:String;
	public var age:Int;
	public var phone_number:String;
	public var zip:Int;
	
	public static function findById(id:Int) : User {
		return HailsDbRecord.findById(User, id);
	}
	
	public static function findAll() : List < User > {
		return HailsDbRecord.findAll(User);
	}

	// this is like "has_many :orders" :
	public function orders() : List < Order > {
		return findAssociatedRecords(Order);
	}
}